package com.seed.core.configuration;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.seed.core.enumeration.ColumnType;

import java.util.Map;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class ColumnConfiguration1 {
    /**
     * 数据库的字段类型，比如 varchar/tinyint 等
     */
    private ColumnType type;
    /**
     * 数据库中的字段长度，比如 varchar(32) 中的 32
     */
    private Integer length;
    private Boolean required;
    private Boolean unique;
    private String defVal; //COLUMN_DEF 默认值
    private String min;
    private String max;
    private String label;
    private String comment; // 字段注释。
    private String onInsertValue;
    private String onUpdateValue;
    private String typeHandler;

    private Map<String, Object> params; // 不同类型的参数

//    private Integer precision;
//    private Integer scale;
//    private String rel;
//    private Map<String, String> options;
//    private Boolean isLarge;

    public ColumnType getType() {
        return type;
    }

    public void setType(ColumnType type) {
        this.type = type;
    }

    public Integer getLength() {
        return length;
    }

    public void setLength(Integer length) {
        this.length = length;
    }

    public Boolean getRequired() {
        return required;
    }

    public void setRequired(Boolean required) {
        this.required = required;
    }

    public Boolean getUnique() {
        return unique;
    }

    public void setUnique(Boolean unique) {
        this.unique = unique;
    }

    public String getDefVal() {
        return defVal;
    }

    public void setDefVal(String defVal) {
        this.defVal = defVal;
    }

    public String getMin() {
        return min;
    }

    public void setMin(String min) {
        this.min = min;
    }

    public String getMax() {
        return max;
    }

    public void setMax(String max) {
        this.max = max;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getOnInsertValue() {
        return onInsertValue;
    }

    public void setOnInsertValue(String onInsertValue) {
        this.onInsertValue = onInsertValue;
    }

    public String getOnUpdateValue() {
        return onUpdateValue;
    }

    public void setOnUpdateValue(String onUpdateValue) {
        this.onUpdateValue = onUpdateValue;
    }

    public String getTypeHandler() {
        return typeHandler;
    }

    public void setTypeHandler(String typeHandler) {
        this.typeHandler = typeHandler;
    }

    public Map<String, Object> getParams() {
        return params;
    }

    public void setParams(Map<String, Object> params) {
        this.params = params;
    }
}

